//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __CFILEINPUTSTREAM_H__
#define __CFILEINPUTSTREAM_H__
#include "_CFileInputStream.h"

CarClass(CFileInputStream)
{
public:
    CARAPI Available(
        /* [out] */ Int32 * pBytes);

    CARAPI Close();

    CARAPI Mark(
        /* [in] */ Int32 readLimit);

    CARAPI IsMarkSupported(
        /* [out] */ Boolean * pSupported);

    CARAPI Read(
        /* [out] */ Byte * pByte);

    CARAPI ReadBuffer(
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI ReadBufferEx(
        /* [in] */ Int32 offset,
        /* [in] */ Int32 length,
        /* [out] */ BufferOf<Byte> * pBuffer);

    CARAPI Reset();

    CARAPI Skip(
        /* [in] */ Int32 length);

    CARAPI GetFileInterface(
        /* [out] */ IBasicFile ** ppFile);

    ~CFileInputStream();

    CARAPI constructor(
        /* [in] */ AString fileName);

    CARAPI constructor(
        /* [in] */ WString fileName);

    CARAPI constructor(
        /* [in] */ IBasicFile * pFile);

    CFileInputStream() : m_pIab(NULL), m_mark(0), m_pos(0) {}

private:
    IAbsoluteIO * m_pIab;
    Int32 m_mark;
    Int32 m_pos;
};

#endif // __CFILEINPUTSTREAM_H__
